package hk.m4s.lr.repair.test.service.news;

import android.content.Context;

import java.util.Map;

import framework.common.widgets.dialogs.UeDialog;
import framework.common.zanetwork.AcountUeHttpUrl;
import framework.common.zanetwork.core.HttpCallback;
import framework.common.zanetwork.core.ResponseCallback;
import hk.m4s.lr.repair.test.model.AccountModel;
import hk.m4s.lr.repair.test.model.NewsModelResult;
import hk.m4s.lr.repair.test.model.NewsTabModelResult;
import hk.m4s.lr.repair.test.service.BaseService;
import okhttp3.Response;

/**
 * Created by qi.wang on 2017/4/5.
 */

public class NewsService extends BaseService{
    public static void getcolumnList(final Context context, Map<String, Object> parmas, final ResponseCallback<NewsTabModelResult> callback) {

        httpHelper.post(AcountUeHttpUrl.columnList(), parmas, new HttpCallback<NewsTabModelResult>() {
            @Override
            public void onRequestBefore() {

            }

            @Override
            public void onSuccess(Response response, NewsTabModelResult o) {

                callback.onSuccess(o);
            }

            @Override
            public void onError(Response response, int errorCode, Exception e) {
                callback.onError(response, errorCode, null, e);

            }

            @Override
            public void onFailure(Response response, String failureMsg, int code) {
                callback.onError(response, code, failureMsg, null);
            }
        });
    }
    public static void getNewList(final Context context, Map<String, Object> parmas,String id ,final ResponseCallback<NewsModelResult> callback) {

        httpHelper.post(AcountUeHttpUrl.columnListId(id), parmas, new HttpCallback<NewsModelResult>() {
            @Override
            public void onRequestBefore() {

            }

            @Override
            public void onSuccess(Response response, NewsModelResult o) {

                callback.onSuccess(o);
            }

            @Override
            public void onError(Response response, int errorCode, Exception e) {
                callback.onError(response, errorCode, null, e);

            }

            @Override
            public void onFailure(Response response, String failureMsg, int code) {
                callback.onError(response, code, failureMsg, null);
            }
        });
    }
}
